package com.nba.common.utils;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.InputStream;
import java.net.URL;

import javax.imageio.ImageIO;

import com.nba.common.tools.ImageCompress;


public class ImageUtil {

    public static boolean createSmall(String imgpath, String savePath, String fileName, String imgSize, String imgExt, int width, int height) {
        try {
            ImageCompress.ImageScale(imgpath, savePath, fileName, imgSize, imgExt, width, height);
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
        return true;
    }
    public static boolean createSmall(InputStream sourceFileStream, String savePath, String fileName, String imgExt, String imgSize, int width, int height) {
        try {
            ImageCompress.ImageScale(sourceFileStream, savePath, fileName, imgExt, imgSize, width, height);;
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
        return true;
    }
}
